R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/strucchange_1.5-3.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 517682 bytes (505 KB) R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 505 KB * installing *source* package ‘strucchange’ ... ** pacchetto ‘strucchange’ aperto con successo con controllo somme MD5 ** using staged installation ** libs using C compiler: ‘x86_64-conda-linux-gnu-cc (Anaconda gcc) 11.2.0’
x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c strucchange_functions.c -o strucchange_functions.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c strucchange_init.c -o strucchange_init.o x86_64-conda-linux-gnu-cc -shared -L/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/simone/miniconda3/envs/MPSMF_ENV/lib -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -L/home/simone/miniconda3/envs/MPSMF_ENV/lib -o strucchange.so strucchange_functions.o strucchange_init.o -llapack -lblas -lgfortran -lm -lgomp -lquadmath -lpthread -L/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/lib -lR
installing to /home/simone/miniconda3/envs/MPSMF_ENV/lib/R/library/00LOCK-strucchange/00new/strucchange/libs ** R ** data *** moving datasets to lazyload DB ** demo ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (strucchange) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/SupMZ_0.2.0.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 5908 bytes R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 5908 bytes * installing *source* package ‘SupMZ’ ... ** pacchetto ‘SupMZ’ aperto con successo con controllo somme MD5 ** using staged installation ** R ** data *** moving datasets to lazyload DB ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (SupMZ) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/tseries_0.10-55.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 164990 bytes (161 KB) R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 161 KB * installing *source* package ‘tseries’ ... ** pacchetto ‘tseries’ aperto con successo con controllo somme MD5 ** using staged installation ** libs using C compiler: ‘x86_64-conda-linux-gnu-cc (Anaconda gcc) 11.2.0’ using Fortran compiler: ‘GNU Fortran (Anaconda gcc) 11.2.0’
x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c arma.c -o arma.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c bdstest.c -o bdstest.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c boot.c -o boot.o x86_64-conda-linux-gnu-gfortran -fpic -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c cfuncs.f90 -o cfuncs.o x86_64-conda-linux-gnu-gfortran -fpic -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c dsumsl.f -o dsumsl.o
dsumsl.f:1004:72:
1004 | 10 W(I) = A*X(I) + Y(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 10 at (1)
dsumsl.f:1123:72:
1123 | 10 Y(I) = S
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 10 at (1)
dsumsl.f:1137:72:
1137 | 10 X(I) = Y(I) / Z(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 10 at (1)
dsumsl.f:1141:72:
1141 | 30 X(I) = Y(I) * Z(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 30 at (1)
dsumsl.f:1224:72:
1224 | 30 Z(I) = CY * Z(I) - CS * W(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 30 at (1)
dsumsl.f:1908:72:
1908 | 10 STEP(I) = G(I) / GNORM
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 10 at (1)
dsumsl.f:1923:72:
1923 | 20 STEP(I) = -NWTSTP(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 20 at (1)
dsumsl.f:1941:72:
1941 | 40 STEP(I) = T * NWTSTP(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 40 at (1)
dsumsl.f:1955:72:
1955 | 60 STEP(I) = T * DIG(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 60 at (1)
dsumsl.f:1982:72:
1982 | 80 STEP(I) = T1*DIG(I) + T2*NWTSTP(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 80 at (1)
dsumsl.f:2226:72:
2226 | 10 X(I) = Y(I)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 10 at (1)
x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c formats.c -o formats.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c garch.c -o garch.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c init.c -o init.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c ppsum.c -o ppsum.o x86_64-conda-linux-gnu-cc -I"/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -I/home/simone/miniconda3/envs/MPSMF_ENV/include -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/simone/miniconda3/envs/MPSMF_ENV/include -fdebug-prefix-map=/workspace/croot/r-base_1695428141831/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=/home/simone/miniconda3/envs/MPSMF_ENV=/usr/local/src/conda-prefix -c tsutils.c -o tsutils.o x86_64-conda-linux-gnu-cc -shared -L/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/simone/miniconda3/envs/MPSMF_ENV/lib -Wl,-rpath-link,/home/simone/miniconda3/envs/MPSMF_ENV/lib -L/home/simone/miniconda3/envs/MPSMF_ENV/lib -o tseries.so arma.o bdstest.o boot.o cfuncs.o dsumsl.o formats.o garch.o init.o ppsum.o tsutils.o -lblas -lgfortran -lm -lgomp -lquadmath -lpthread -lgfortran -lm -lgomp -lquadmath -lpthread -L/home/simone/miniconda3/envs/MPSMF_ENV/lib/R/lib -lR
installing to /home/simone/miniconda3/envs/MPSMF_ENV/lib/R/library/00LOCK-tseries/00new/tseries/libs ** R ** data ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (tseries) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/skewt_1.0.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 2241 bytes R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 2241 bytes * installing *source* package ‘skewt’ ... ** pacchetto ‘skewt’ aperto con successo con controllo somme MD5 ** using staged installation ** R ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (skewt) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/fitdistrplus_1.1-11.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 1551868 bytes (1.5 MB) R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 1.5 MB * installing *source* package ‘fitdistrplus’ ... ** pacchetto ‘fitdistrplus’ aperto con successo con controllo somme MD5 ** using staged installation ** R ** data ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (fitdistrplus) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/glogis_1.0-2.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 85856 bytes (83 KB) R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 83 KB * installing *source* package ‘glogis’ ... ** pacchetto ‘glogis’ aperto con successo con controllo somme MD5 ** using staged installation ** R ** data ** demo ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (glogis) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto R[write to console]: apertura URL 'https://cran.mirror.garr.it/CRAN/src/contrib/sn_2.1.1.tar.gz' R[write to console]: Content type 'application/octet-stream' R[write to console]: length 827061 bytes (807 KB) R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: = R[write to console]: R[write to console]: downloaded 807 KB * installing *source* package ‘sn’ ... ** pacchetto ‘sn’ aperto con successo con controllo somme MD5 ** using staged installation ** R ** data ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (sn) R[write to console]: R[write to console]: R[write to console]: I pacchetti scaricati con il codice sorgente sono in ‘/tmp/RtmpLq1eyO/downloaded_packages’ R[write to console]: R[write to console]: R[write to console]: Aggiornamento indice HTML dei pacchetti in '.Library' R[write to console]: Making 'packages.html' ... R[write to console]: fatto
<rpy2.rinterface_lib.sexp.NULLType object at 0x7f00bc52cb80> [RTYPES.NILSXP]
Nato nel 2009, il concetto di criptovaluta si è evoluto ben oltre il suo pioniere, il Bitcoin. Le criptovalute rappresentano oggi un'ampia gamma di asset digitali che fungono da alternative alle valute FIAT tradizionali, come l'USD e l'EUR.
Le criptovalute si distinguono per la loro natura decentralizzata. Questo significa che non sono controllate centralmente da istituzioni governative o entità finanziarie, mitigando il rischio di inflazione derivante da corruzione o azioni illegittime.
Tuttavia, proprio la decentralizzazione, pone il rischio che una valuta digitale corra il rischio di essere duplicata e utilizzata in più di un'occasione (problema della "doppia spesa"). Le criptovalute risolvono questo problema grazie a reti peer-to-peer che utilizzano algoritmi di consenso come il proof-of-work garantendo che ogni transazione sia verificata e registrata in modo univoco.
La tecnologia blockchain, sostenuta da una rete globale di minatori, costituisce la spina dorsale delle criptovalute. Questi minatori sono essenziali per garantire la sicurezza e l'integrità della blockchain, venendo ricompensati con nuove unità di criptovaluta per il loro contributo al mantenimento della rete. La blockchain, inoltre, offre una trasparenza senza precedenti e un registro immutabile, rendendo difficile qualsiasi tentativo di frode o manipolazione.
Le criptovalute, essendo un fenomeno relativamente nuovo, sono soggette a una volatilità significativa, rendendo gli investimenti in esse potenzialmente rischiosi. La continua educazione e la regolamentazione del settore sono fondamentali per mitigare questi svantaggi e favorire una maggiore adozione e comprensione delle criptovalute tra la popolazione generale.
La liquidità di un mercato finanziario si riferisce alla facilità con cui gli investitori possono comprare o vendere titoli finanziari (come azioni, obbligazioni, valute, ecc.) senza causare significative fluttuazioni nei prezzi di mercato. In altre parole, un mercato finanziario è considerato liquido quando gli investitori possono effettuare transazioni con relativa rapidità ed efficienza, con costi di transazione minimi e senza causare impatti significativi sui prezzi degli strumenti finanziari.
Un mercato finanziario altamente liquido è caratterizzato da una maggiore attività di scambio di titoli, un elevato numero di partecipanti, un elevato volume di scambi giornalieri e una stretta differenza tra i prezzi di acquisto (offerta) e i prezzi di vendita (domanda), noti come spread. Al contrario, in un mercato finanziario con scarsa liquidità, può essere difficile acquistare o vendere titoli e ciò può comportare costi di transazione più elevati e prezzi più volatili.
La liquidità è un importante fattore da considerare quando si decide di investire in un mercato finanziario. I mercati altamente liquidi sono generalmente considerati meno rischiosi, poiché gli investitori possono entrare o uscire facilmente dalle posizioni. D'altra parte, i mercati con bassa liquidità possono comportare maggiori rischi e sfide per gli investitori, poiché potrebbe essere difficile convertire i propri investimenti in denaro contante senza influire in modo significativo sui prezzi del mercato.
Acquisto di criptovalute:
Conservazione delle criptovalute:
Negoziazione:
Uscita dal mercato:
Per quanto riguarda la liquidità del mercato delle criptovalute, essa può variare notevolmente da una criptovaluta all'altra e da un momento all'altro.
Le criptovalute più popolari come Bitcoin ed Ethereum tendono ad avere mercati più liquidi, con un alto volume di scambi giornalieri. Tuttavia, le criptovalute meno conosciute o di nicchia possono avere mercati meno liquidi, il che significa che potrebbe essere più difficile acquistare o vendere grandi quantità senza influire significativamente sui prezzi.
In generale, il mercato delle criptovalute è noto per la sua volatilità, il che può comportare fluttuazioni dei prezzi molto rapide e ampie.
I dati sono stati estratti dal sito Yahoo Finance usando delle REST API. I dati sono stati scaricati per quattro criptovalute:
I dati sono stati scaricati per l'intervallo temporale tra 2018-01-01 e 2023-09-01
--------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) Cell In [15], line 6 3 interval : str = "daily" 5 for crypto in cryptoList : ----> 6 DataExtractor.extractData(crypto, extractionStartDate, extractionEndDate, interval) File ~/Scrivania/University/MPSMF/MPSMF_Project/DataExtractor.py:37, in extractData(currency, startDate, endDate, interval) 34 def extractData(currency : str, startDate : str, endDate : str, interval : str) : 35 #grab dataset 36 query_url = create_download_url(currency, startDate, endDate, interval) ---> 37 df = pd.read_csv(query_url) 38 df.set_index('Date', inplace=True) 40 #Export as csv File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/parsers/readers.py:948, in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend) 935 kwds_defaults = _refine_defaults_read( 936 dialect, 937 delimiter, (...) 944 dtype_backend=dtype_backend, 945 ) 946 kwds.update(kwds_defaults) --> 948 return _read(filepath_or_buffer, kwds) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/parsers/readers.py:611, in _read(filepath_or_buffer, kwds) 608 _validate_names(kwds.get("names", None)) 610 # Create the parser. --> 611 parser = TextFileReader(filepath_or_buffer, **kwds) 613 if chunksize or iterator: 614 return parser File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1448, in TextFileReader.__init__(self, f, engine, **kwds) 1445 self.options["has_index_names"] = kwds["has_index_names"] 1447 self.handles: IOHandles | None = None -> 1448 self._engine = self._make_engine(f, self.engine) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1705, in TextFileReader._make_engine(self, f, engine) 1703 if "b" not in mode: 1704 mode += "b" -> 1705 self.handles = get_handle( 1706 f, 1707 mode, 1708 encoding=self.options.get("encoding", None), 1709 compression=self.options.get("compression", None), 1710 memory_map=self.options.get("memory_map", False), 1711 is_text=is_text, 1712 errors=self.options.get("encoding_errors", "strict"), 1713 storage_options=self.options.get("storage_options", None), 1714 ) 1715 assert self.handles is not None 1716 f = self.handles.handle File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/common.py:718, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options) 715 codecs.lookup_error(errors) 717 # open URLs --> 718 ioargs = _get_filepath_or_buffer( 719 path_or_buf, 720 encoding=encoding, 721 compression=compression, 722 mode=mode, 723 storage_options=storage_options, 724 ) 726 handle = ioargs.filepath_or_buffer 727 handles: list[BaseBuffer] File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/common.py:372, in _get_filepath_or_buffer(filepath_or_buffer, encoding, compression, mode, storage_options) 370 # assuming storage_options is to be interpreted as headers 371 req_info = urllib.request.Request(filepath_or_buffer, headers=storage_options) --> 372 with urlopen(req_info) as req: 373 content_encoding = req.headers.get("Content-Encoding", None) 374 if content_encoding == "gzip": 375 # Override compression based on Content-Encoding header File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/site-packages/pandas/io/common.py:274, in urlopen(*args, **kwargs) 268 """ 269 Lazy-import wrapper for stdlib urlopen, as that imports a big chunk of 270 the stdlib. 271 """ 272 import urllib.request --> 274 return urllib.request.urlopen(*args, **kwargs) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context) 214 else: 215 opener = _opener --> 216 return opener.open(url, data, timeout) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:519, in OpenerDirector.open(self, fullurl, data, timeout) 516 req = meth(req) 518 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method()) --> 519 response = self._open(req, data) 521 # post-process response 522 meth_name = protocol+"_response" File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:536, in OpenerDirector._open(self, req, data) 533 return result 535 protocol = req.type --> 536 result = self._call_chain(self.handle_open, protocol, protocol + 537 '_open', req) 538 if result: 539 return result File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args) 494 for handler in handlers: 495 func = getattr(handler, meth_name) --> 496 result = func(*args) 497 if result is not None: 498 return result File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:1391, in HTTPSHandler.https_open(self, req) 1390 def https_open(self, req): -> 1391 return self.do_open(http.client.HTTPSConnection, req, 1392 context=self._context, check_hostname=self._check_hostname) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/urllib/request.py:1348, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args) 1346 try: 1347 try: -> 1348 h.request(req.get_method(), req.selector, req.data, headers, 1349 encode_chunked=req.has_header('Transfer-encoding')) 1350 except OSError as err: # timeout error 1351 raise URLError(err) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:1283, in HTTPConnection.request(self, method, url, body, headers, encode_chunked) 1280 def request(self, method, url, body=None, headers={}, *, 1281 encode_chunked=False): 1282 """Send a complete request to the server.""" -> 1283 self._send_request(method, url, body, headers, encode_chunked) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:1329, in HTTPConnection._send_request(self, method, url, body, headers, encode_chunked) 1325 if isinstance(body, str): 1326 # RFC 2616 Section 3.7.1 says that text default has a 1327 # default charset of iso-8859-1. 1328 body = _encode(body, 'body') -> 1329 self.endheaders(body, encode_chunked=encode_chunked) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:1278, in HTTPConnection.endheaders(self, message_body, encode_chunked) 1276 else: 1277 raise CannotSendHeader() -> 1278 self._send_output(message_body, encode_chunked=encode_chunked) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:1038, in HTTPConnection._send_output(self, message_body, encode_chunked) 1036 msg = b"\r\n".join(self._buffer) 1037 del self._buffer[:] -> 1038 self.send(msg) 1040 if message_body is not None: 1041 1042 # create a consistent interface to message_body 1043 if hasattr(message_body, 'read'): 1044 # Let file-like take precedence over byte-like. This 1045 # is needed to allow the current position of mmap'ed 1046 # files to be taken into account. File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:976, in HTTPConnection.send(self, data) 974 if self.sock is None: 975 if self.auto_open: --> 976 self.connect() 977 else: 978 raise NotConnected() File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/http/client.py:1455, in HTTPSConnection.connect(self) 1452 else: 1453 server_hostname = self.host -> 1455 self.sock = self._context.wrap_socket(self.sock, 1456 server_hostname=server_hostname) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/ssl.py:513, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session) 507 def wrap_socket(self, sock, server_side=False, 508 do_handshake_on_connect=True, 509 suppress_ragged_eofs=True, 510 server_hostname=None, session=None): 511 # SSLSocket class handles server_hostname encoding before it calls 512 # ctx._wrap_socket() --> 513 return self.sslsocket_class._create( 514 sock=sock, 515 server_side=server_side, 516 do_handshake_on_connect=do_handshake_on_connect, 517 suppress_ragged_eofs=suppress_ragged_eofs, 518 server_hostname=server_hostname, 519 context=self, 520 session=session 521 ) File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/ssl.py:1104, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session) 1101 if timeout == 0.0: 1102 # non-blocking 1103 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") -> 1104 self.do_handshake() 1105 except (OSError, ValueError): 1106 self.close() File ~/miniconda3/envs/MPSMF_ENV/lib/python3.10/ssl.py:1375, in SSLSocket.do_handshake(self, block) 1373 if timeout == 0.0 and block: 1374 self.settimeout(None) -> 1375 self._sslobj.do_handshake() 1376 finally: 1377 self.settimeout(timeout) KeyboardInterrupt:
Per tenere conto dell'inflazione degli ultimi anni consideriamo una correzione sui prezzi fatta usando il Consumer Price Index (CPI), ottenuto estraendo i dati dal sito della FRED. I dati estratti da quest'ultimo sito sono mensili, mentre i dati scaricati per le criptovalute sono periodici. Per rendere i dati omogenei procediamo facendo un'interpolazione lineare del CPI, ottenendo il dato per ogni giorno.
<Figure size 640x480 with 0 Axes>
| Date | CPI | Infation | |
|---|---|---|---|
| 0 | 2018-01-01 | 248.859000 | 0.013664 |
| 1 | 2018-01-02 | 248.880613 | 0.008685 |
| 2 | 2018-01-03 | 248.902226 | 0.008684 |
| 3 | 2018-01-04 | 248.923839 | 0.008683 |
| 4 | 2018-01-05 | 248.945452 | 0.008683 |
| ... | ... | ... | ... |
| 2065 | 2023-08-28 | 307.324613 | 0.012723 |
| 2066 | 2023-08-29 | 307.363710 | 0.012722 |
| 2067 | 2023-08-30 | 307.402806 | 0.012720 |
| 2068 | 2023-08-31 | 307.441903 | 0.012718 |
| 2069 | 2023-09-01 | 307.481000 | 0.012717 |
2070 rows × 3 columns
Ottenuto il dato sull'inflazione andiamo a normalizzare i prezzi ottenendo:
$ NormalizedClose = Close * (1- Inflation)$
| Date | Open | High | Low | Close | Adj Close | Volume | NormalizedClose | |
|---|---|---|---|---|---|---|---|---|
| 0 | 2018-01-01 | 755.757019 | 782.530029 | 742.004028 | 772.640991 | 772.640991 | 2595760128 | 762.083453 |
| 1 | 2018-01-02 | 772.346008 | 914.830017 | 772.346008 | 884.443970 | 884.443970 | 5783349760 | 876.762752 |
| 2 | 2018-01-03 | 886.000000 | 974.471008 | 868.450989 | 962.719971 | 962.719971 | 5093159936 | 954.359668 |
| 3 | 2018-01-04 | 961.713013 | 1045.079956 | 946.085999 | 980.921997 | 980.921997 | 6502859776 | 972.404366 |
| 4 | 2018-01-05 | 975.750000 | 1075.390015 | 956.325012 | 997.719971 | 997.719971 | 6683149824 | 989.057231 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2065 | 2023-08-28 | 1657.439819 | 1659.328735 | 1627.446777 | 1652.457397 | 1652.457397 | 4855588534 | 1631.432731 |
| 2066 | 2023-08-29 | 1652.274170 | 1742.637329 | 1639.576172 | 1729.725708 | 1729.725708 | 11304916729 | 1707.720736 |
| 2067 | 2023-08-30 | 1729.676636 | 1730.564697 | 1697.147217 | 1705.112183 | 1705.112183 | 5023904190 | 1683.423095 |
| 2068 | 2023-08-31 | 1705.364502 | 1720.011963 | 1634.850952 | 1645.639160 | 1645.639160 | 6593153505 | 1624.709233 |
| 2069 | 2023-09-01 | 1645.581299 | 1653.531738 | 1603.034180 | 1628.491211 | 1628.491211 | 6104510092 | 1607.782013 |
2070 rows × 8 columns
Per avere una maggiore stabilità dei valori numerici, passiamo allo studio del logaritmo dei prezzi di chiusura considerandolo come proxy dello studio condotto sui valori originali.
| Date | Open | High | Low | Close | Adj Close | Volume | NormalizedClose | LogClosePrice | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 2018-01-01 | 14112.200195 | 14112.200195 | 13154.700195 | 13657.200195 | 13657.200195 | 10291200000 | 13470.585182 | 4.129386 |
| 1 | 2018-01-02 | 13625.000000 | 15444.599609 | 13163.599609 | 14982.099609 | 14982.099609 | 16846600192 | 14851.983090 | 4.171784 |
| 2 | 2018-01-03 | 14978.200195 | 15572.799805 | 14844.500000 | 15201.000000 | 15201.000000 | 16871900160 | 15068.993839 | 4.178084 |
| 3 | 2018-01-04 | 15270.700195 | 15739.700195 | 14522.200195 | 15599.200195 | 15599.200195 | 21783199744 | 15463.747809 | 4.189315 |
| 4 | 2018-01-05 | 15477.200195 | 17705.199219 | 15202.799805 | 17429.500000 | 17429.500000 | 23840899072 | 17278.167730 | 4.237498 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2065 | 2023-08-28 | 26089.615234 | 26198.578125 | 25880.599609 | 26106.150391 | 26106.150391 | 11002805166 | 25773.994720 | 4.411182 |
| 2066 | 2023-08-29 | 26102.486328 | 28089.337891 | 25912.628906 | 27727.392578 | 27727.392578 | 29368391712 | 27374.654281 | 4.437349 |
| 2067 | 2023-08-30 | 27726.083984 | 27760.160156 | 27069.207031 | 27297.265625 | 27297.265625 | 16343655235 | 26950.043426 | 4.430559 |
| 2068 | 2023-08-31 | 27301.929688 | 27456.078125 | 25752.929688 | 25931.472656 | 25931.472656 | 20181001451 | 25601.665345 | 4.408268 |
| 2069 | 2023-09-01 | 25934.021484 | 26125.869141 | 25362.609375 | 25800.724609 | 25800.724609 | 17202862221 | 25472.621935 | 4.406074 |
2070 rows × 9 columns
<Figure size 640x480 with 0 Axes>
Tracciamo ora gli autocorrelogrammi e gli autocorrelogrammi parziali delle serie dei prezzi logaritmici. Ricordiamo che:
<Figure size 640x480 with 0 Axes>
Come si vede dai grafici:
Cerchiamo una componente di Random Walk all'interno delle serie.
La presenza di una componente di Random Walk nella serie è indice del fatto che il mercato non è prevedibile e che quindi il suo andamento può salire o scendere in modo casuale, ovvero assume valori:
Le componenti di Random Walk vengono ricercate usando due Test di Ipotesi:
Nel test di KPSS abbiamo:
Nel test di ADF abbiamo:
Nel nostro caso vogliamo:
KPSS ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 4.630432272815153 │ 0.01 │ Reject │ │ BTC-USD │ 4.820559865672976 │ 0.01 │ Reject │ │ DASH-USD │ 2.7531299544913352 │ 0.01 │ Reject │ │ XRP-USD │ 0.918683154822733 │ 0.01 │ Reject │ └──────────┴────────────────────┴────────┴─────────┘
ADF ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ -0.9501313424178289 │ 0.7710157360162664 │ Accept │ │ BTC-USD │ -0.978510604401754 │ 0.7610211585021541 │ Accept │ │ DASH-USD │ -2.8180938650045064 │ 0.0557353087206187 │ Accept │ │ XRP-USD │ -3.500868599705032 │ 0.007964814582617451 │ Reject │ └──────────┴─────────────────────┴──────────────────────┴─────────┘
Dai test condotti si vede che tutte le serie hanno natura di Random Walk, fatta eccezione per l'ultima che non passa il test ADF. Tuttavia, passando il test KPSS ed essendo il valore del pValue abbastanza vicino al limite possiamo concludere che il trend stocastico sia presente anche per la crypto XRP-USD ma che sia un trend debole.
Procediamo lo studio con l'analisi del rumore.
Passiamo al differencing della serie storica, ottenendo $Y_{t+1} - Y_{t} = W_{t}$ e procedendo con un'analisi del termine $W_{t}$.
Il differencing viene fatto sul risultato del passaggio al logaritmo dei valori originari. Siano:
Fare il differencing dei valori logaritmici ci permette di fare quanto segue:
$Y_{t+1} - Y_{t} = \log(P_{t+1}) - \log(P_t) = \log(\frac{P_{t+1}}{P_{t}}) = \log(R) = W_t$
Ovvero analizzare se il rendimento ha o meno natura di White Noise, controllando:
<Figure size 640x480 with 0 Axes>
Dai grafici sull'andamento notiamo clustering di volatilità e questo ci fa supporre presenza di autocorrelazione.
Per l'analisi di stazionarietà eseguiamo due test:
Nel test di KPSS abbiamo:
Nel test di Adfuller abbiamo:
Nel caso di white noise si avrebbe:
KPSS ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 0.23201574524870314 │ 0.1 │ Accept │ │ BTC-USD │ 0.15674142996559834 │ 0.1 │ Accept │ │ DASH-USD │ 0.13769918829263092 │ 0.1 │ Accept │ │ XRP-USD │ 0.19808342863898767 │ 0.1 │ Accept │ └──────────┴─────────────────────┴────────┴─────────┘
ADF ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ -13.748813873133498 │ 1.0600349812346284e-25 │ Reject │ │ BTC-USD │ -31.470467916876196 │ 0.0 │ Reject │ │ DASH-USD │ -21.645263875919735 │ 0.0 │ Reject │ │ XRP-USD │ -46.79501030099321 │ 0.0 │ Reject │ └──────────┴─────────────────────┴────────────────────────┴─────────┘
Dal test di KPSS e dal test ADF, possiamo concludere che il differencing $W_t$ è stazionario
Per l'analisi di eteroschedasticità eseguiamo i seguenti test:
Nel test di Breusch-Pagan abbiamo:
Nel test di White abbiamo:
Nel caso di white noise si avrebbe:
Breusch-Pagan ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 8.567367566736669 │ 0.0034597918568196914 │ Reject │ │ BTC-USD │ 7.763759935805086 │ 0.005379165131515243 │ Reject │ │ DASH-USD │ 2.276765009171112 │ 0.1314783730532143 │ Accept │ │ XRP-USD │ 1.2467607341644058 │ 0.2643018406639988 │ Accept │ └──────────┴────────────────────┴───────────────────────┴─────────┘
White ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 5.26508181913567 │ 0.005238555530471663 │ Reject │ │ BTC-USD │ 4.141400487811925 │ 0.016032762971599328 │ Reject │ │ DASH-USD │ 3.666072606577798 │ 0.025743255972081297 │ Reject │ │ XRP-USD │ 0.7598677076192619 │ 0.4678589731665155 │ Accept │ └──────────┴────────────────────┴──────────────────────┴─────────┘
Notiamo che XRP-USD è l'unica delle Crypto per cui il test passa: analizzando il grafico possiamo notare come ci sia una certa costanza nella volatilità della serie, quindi anche graficamente abbiamo una conferma del risultato.
Per le altre crypto invece abbiamo che, trattandosi di serie abbastanza lunghe, è ragionevole che la varianza non sia costante.
Per l'Autocorrelazione consideriamo i seguenti test:
Per il test Ljung-Box:
Nel caso di white noise si avrebbe:
Ljung-Box ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 31.609722534078987 │ 0.0004650065716092994 │ Reject │ │ BTC-USD │ 16.925034452734113 │ 0.07603932218108504 │ Accept │ │ DASH-USD │ 15.716773963771859 │ 0.10803220218423684 │ Accept │ │ XRP-USD │ 7.977674132723926 │ 0.631017790629593 │ Accept │ └──────────┴────────────────────┴───────────────────────┴─────────┘
Il test quindi Accetta e i dati non dovrebbero quindi essere autocorrelati. Questo và in contraddizione con ciò che avevamo dedotto osservando i grafici relativi al differencing, in cui sembravano essere presenti dei cluster di varianza costante, in cui a basse [risp: alte] varianze seguono zone di bassa [risp: alta] varianza.
Andiamo per completezza a vedere gli autocorrelogrammi e gli autocorrelogrammi parziali dei dati di differencing.
<Figure size 640x480 with 0 Axes>
Riassumendo abbiamo:
Questo fenomeno potrebbe essere dovuto al fatto che i dati sono molti, e quindi il grande numero di dati potrebbe offuscare l'autocorrelazione portando i dati a tendere al gaussiano... Ci fa supporre la presenza di punti di rottura nella struttura!
Passiamo quindi, dopo dei veloci test sulla gaussianità, all'analisi delle rotture strutturali.
Per l'analisi di normalità eseguiamo i seguenti test:
Nel test di Shapiro-Wilk abbiamo:
Nel test di Kolmogorov-Smirnov abbiamo:
Nel caso di white noise:
Shapiro-Wilk ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 0.9225029349327087 │ 2.243272511905845e-31 │ Reject │ │ BTC-USD │ 0.9065624475479126 │ 7.687562699532387e-34 │ Reject │ │ DASH-USD │ 0.9040272235870361 │ 3.3494620980164206e-34 │ Reject │ │ XRP-USD │ 0.8357081413269043 │ 7.15923385423549e-42 │ Reject │ └──────────┴────────────────────┴────────────────────────┴─────────┘
Kolmogorov-Smirnov ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 0.4705378122861261 │ 0.0 │ Reject │ │ BTC-USD │ 0.47608764853183083 │ 0.0 │ Reject │ │ DASH-USD │ 0.46608875744466827 │ 0.0 │ Reject │ │ XRP-USD │ 0.4642030732172747 │ 0.0 │ Reject │ └──────────┴─────────────────────┴────────┴─────────┘
Notiamo quindi che i due test ci fanno rigettare in entrambi i casi l'ipotesi nulla di normalità dei dati.
Cerchiamo i punti di rottura usando le funzioni di R:
I test rilevano la presenza dei seguenti punti di rottura, come sospettavamo...
Structural Breakpoints ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ Breakpoint ┃ FStats ┃ SupMZ ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ | 2018-11-06 | 2020-02-06 | 2021-01-02 | 2022-05-10 | │ | 2020-12-29 | │ | 2021-01-04 | │ │ BTC-USD │ | 2019-05-12 | 2020-12-15 | 2022-05-08 | │ | 2020-11-11 | │ | 2020-11-06 | │ │ DASH-USD │ | 2018-11-06 | 2019-09-22 | 2021-01-09 | 2022-05-04 | │ | 2018-11-07 | │ | 2022-05-12 | │ │ XRP-USD │ | 2018-11-18 | 2019-09-24 | 2021-02-08 | 2022-04-28 | │ | 2021-02-08 | │ | 2021-02-05 | │ └──────────┴────────────────────────────────────────────────────────┴─────────────────┴─────────────────┘
<Figure size 640x480 with 0 Axes>
<Figure size 640x480 with 0 Axes>
Notiamo che test diversi rilevano punti di rottura simili: scegliamo quindi di procedere con un "voto a maggioranza", prendendo il punto di rottura più simile tra i tre test e considerando i dati a partire da tale punto in poi.
Dividiamo inoltre il dataset ristretto per ogni crypto in due parti, training e test set: manteniamo nel training circa il 90% dei dati di ogni strumento.
Consideriamo ora solamente i dati di training, per ogni crypto, sul dataset ristretto all'ultimo punto di rottura.
<Figure size 640x480 with 0 Axes>
Come nel primo caso analizziamo il differencing e vediamo se questo ha natura di white noise.
Per l'analisi di stazionarietà eseguiamo due test:
Nel test di KPSS abbiamo:
Nel test di Adfuller abbiamo:
Nel caso di white noise si avrebbe:
KPSS ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 0.30402339982507376 │ 0.1 │ Accept │ │ BTC-USD │ 0.26793706713609056 │ 0.1 │ Accept │ │ DASH-USD │ 0.14448487432870857 │ 0.1 │ Accept │ │ XRP-USD │ 0.10857489114721602 │ 0.1 │ Accept │ └──────────┴─────────────────────┴────────┴─────────┘
ADF ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ -31.463043189797844 │ 0.0 │ Reject │ │ BTC-USD │ -30.483765580661746 │ 0.0 │ Reject │ │ DASH-USD │ -15.051422863190458 │ 9.281783031352217e-28 │ Reject │ │ XRP-USD │ -31.024464015415518 │ 0.0 │ Reject │ └──────────┴─────────────────────┴───────────────────────┴─────────┘
Per l'analisi di eteroschedasticità eseguiamo i seguenti test:
Nel test di Breusch-Pagan abbiamo:
Nel test di White abbiamo:
Nel caso di white noise si avrebbe:
Breusch-Pagan ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 25.05566267671057 │ 6.737702332420841e-07 │ Reject │ │ BTC-USD │ 25.84501763683427 │ 4.5114279068198483e-07 │ Reject │ │ DASH-USD │ 2.495168564366106 │ 0.11492299248948996 │ Accept │ │ XRP-USD │ 34.8344311264828 │ 5.204886672228533e-09 │ Reject │ └──────────┴───────────────────┴────────────────────────┴─────────┘
White ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 13.1651660977433 │ 2.32843202022156e-06 │ Reject │ │ BTC-USD │ 13.22301453319326 │ 2.193663541133534e-06 │ Reject │ │ DASH-USD │ 3.299977334208391 │ 0.037811687468737934 │ Reject │ │ XRP-USD │ 23.00017453495107 │ 1.885248700990853e-10 │ Reject │ └──────────┴───────────────────┴───────────────────────┴─────────┘
Per l'Autocorrelazione consideriamo i seguenti test:
Per il test Ljung-Box:
Nel caso di white noise si avrebbe:
Ljung-Box ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 20.74439638246904 │ 0.022948121087501706 │ Reject │ │ BTC-USD │ 12.632829754955273 │ 0.24493117060834974 │ Accept │ │ DASH-USD │ 9.348220225953458 │ 0.49940562393741117 │ Accept │ │ XRP-USD │ 16.883011215521183 │ 0.07699305871115295 │ Accept │ └──────────┴────────────────────┴──────────────────────┴─────────┘
<Figure size 640x480 with 0 Axes>
Nonostante la restrizione del dataset i risultati del test di Lijung-Box e gli autocorrelogrammi sembra proprio che tra i rendimenti delle criptovalute la correlazione seriale sia abbastanza scarsa.
Questo risultato è abbastanza deludente in termini di strategie di trading basate sulla "compra-vendita" più o meno intelligente dei titoli. A questo punto procediamo con l'esaminare l'eventuale correlazione sui quadrati dei rendimenti.
L'analisi sulla correlazione dei quadrati risulta a questo punto necessaria poiché, ricordando che:
$D^{2}[X_t] = E[X_t^{2}] + E^{2}[X_t]$
Se la media fosse nulla quindi la varianza dei rendimenti corrisponderebbe con il quadrato dei rendimenti stessi:
$D^{2}[X_t] = E[X_t^{2}]$
Zero Mean Test ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ ┃ Crypto ┃ T-Statistic ┃ P-Value ┃ Result ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ │ ETH-USD │ 0.33808066325759595 │ 0.7353367184851297 │ Accept │ │ BTC-USD │ 0.3725821323911949 │ 0.7094976528285228 │ Accept │ │ DASH-USD │ -1.459006273766798 │ 0.14471524793122822 │ Accept │ │ XRP-USD │ -0.5918757465602607 │ 0.5539984936921993 │ Accept │ └──────────┴─────────────────────┴─────────────────────┴────────┘
Per nessuno degli strumenti finanziari possiamo rigettare l'ipotesi nulla di media nulla al 95%.
Procediamo quindi con l'analisi dei rendimenti logaritmici quadrati che, qualora risultassero autocorrelati, potrebbero essere modellati con dei modelli GARCH.
<Figure size 640x480 with 0 Axes>
Dall'evidenza grafica sembrerebbe esserci un effetto clustering abbastanza marcato. Per averne conferma procediamo con un test di Ljung-Box sui dati quadratici.
Ljung-Box ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 107.45662340504884 │ 1.7362744278257656e-18 │ Reject │ │ BTC-USD │ 28.435878927917237 │ 0.0015366636984585028 │ Reject │ │ DASH-USD │ 20.296369471575147 │ 0.026570915198950266 │ Reject │ │ XRP-USD │ 124.35893071112875 │ 6.585066550321394e-22 │ Reject │ └──────────┴────────────────────┴────────────────────────┴─────────┘
Dai risultati si evince infatti che per tutte le monete si può rigettare l'ipotesi nulla di non-autocorrelazione, concludiamo quindi che tutte le monete presentano autocorrelazione.
Procediamo poi per completezza a graficare gli autocorrelogrammi per le varie monete.
<Figure size 640x480 with 0 Axes>
Comme già detto, essendo presente autocorrelazione nella volatilità dei rendimenti, possiamo procedere a modellare tramite Generalized ARCH model (GARCH).
In genere, solo parametrazioni ARCH piuttosto ricche sono in grado di misurare adeguatamente le serie finanziarie. Tuttavia, i modelli ampiamente parametrizzati possono essere instabili nella previsione e difficili da stimare.
Per superare le carenze del modello ARCH, Tim Bollerslev ha proposto una generalizzazione del modello ARCH chiamata GARCH (Bollerslev, 1986). Il modello consente di valutare adeguatamente i rendimenti finanziari mantenendo un numero ridotto di parametri.
Nella pratica, il modello GARCH è uno dei modelli di volatilità più utilizzati con successo.
GARCH models parameters ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ alpha_0 ┃ alpha_1 ┃ beta_1 ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 8.76217244982038e-06 │ 0.09991210016705068 │ 0.8801005312804235 │ │ BTC-USD │ 5.27417398334347e-06 │ 0.0499931225074402 │ 0.9298499390118588 │ │ DASH-USD │ 5.795185708522076e-05 │ 0.10761903431571908 │ 0.7379445393229688 │ │ XRP-USD │ 1.5061776323395724e-05 │ 0.10021435919806294 │ 0.8785064342363201 │ └──────────┴────────────────────────┴─────────────────────┴────────────────────┘
Per valutare la bontà del modello procediamo con un analisi sui residui.
Valutiamo:
KPSS ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 0.17432400371354975 │ 0.1 │ Accept │ │ BTC-USD │ 0.19844539579445133 │ 0.1 │ Accept │ │ DASH-USD │ 0.11788575359356059 │ 0.1 │ Accept │ │ XRP-USD │ 0.10803807541946762 │ 0.1 │ Accept │ └──────────┴─────────────────────┴────────┴─────────┘
ADF ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ -15.693567424856559 │ 1.4241061163949666e-28 │ Reject │ │ BTC-USD │ -29.079199700789154 │ 0.0 │ Reject │ │ DASH-USD │ -20.551692589739947 │ 0.0 │ Reject │ │ XRP-USD │ -30.272866468250122 │ 0.0 │ Reject │ └──────────┴─────────────────────┴────────────────────────┴─────────┘
Ljung-Box ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 12.429167305858956 │ 0.2573598822424017 │ Accept │ │ BTC-USD │ 11.049385706036809 │ 0.35368336960583363 │ Accept │ │ DASH-USD │ 7.738434333520586 │ 0.6543690599625923 │ Accept │ │ XRP-USD │ 13.16396100965736 │ 0.21464853827574287 │ Accept │ └──────────┴────────────────────┴─────────────────────┴─────────┘
Breusch-Pagan ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 3.0552372793185714 │ 0.0808291850355068 │ Accept │ │ BTC-USD │ 4.81037750869296 │ 0.028547494279450508 │ Reject │ │ DASH-USD │ 0.16268201483311248 │ 0.6868977927761047 │ Accept │ │ XRP-USD │ 6.365618133810369 │ 0.011819036032203746 │ Reject │ └──────────┴─────────────────────┴──────────────────────┴─────────┘
White ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Crypto ┃ StatValue ┃ pValue ┃ Outcome ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ │ ETH-USD │ 2.1579503833990525 │ 0.11617918995361964 │ Accept │ │ BTC-USD │ 2.5589215991266947 │ 0.07795936137356213 │ Accept │ │ DASH-USD │ 1.432578207289038 │ 0.2398217511979006 │ Accept │ │ XRP-USD │ 3.4750426643481562 │ 0.031407409545298644 │ Reject │ └──────────┴────────────────────┴──────────────────────┴─────────┘
Grafichiamo quindi i residui ottenuti.
<Figure size 1600x900 with 0 Axes>
<Figure size 640x480 with 0 Axes>
Per quanto riguarda l'autocorrelazione andiamo a produrre degli autocorrelogrammi.
<Figure size 640x480 with 0 Axes>
Con l'obiettivo di generare delle bande di predizione in cui ci aspettiamo che ricada il nostro testing set andiamo ad applicare la tecnica di Bootstrap. Questa tecnica, che sembra empiricamente funzionare discretamente bene, è molto facile e veloce rispetto ad un tradizionale approccio parametrico ma non dà informazioni complete sul processo generatore della serie dei residui.
Procediamo quindi con i seguenti passi per ogni cryptovaluta:
<Figure size 640x480 with 0 Axes>
Partendo dalle traiettorie generate, andiamo a calcolare i quantili empirici per ogni t e costruiamo le nostre bande di predizione al 10% e 90%.
Grafichiamo poi il tutto sui dati di testing effettivi.
<Figure size 640x480 with 0 Axes>
Non avendo informazioni sul processo generatore dei residui e non potendo quindi fare delle conclusioni di carattere statistico con il solo approccio di Bootstrap, approfondiamo la trattazione considerando un approccio parametrico.
Per l'approccio parametrico abbiamo due ipotesi sulla distribuzione dei residui:
Andiamo quindi a vedere quale tra le due, per ogni crypto, cattura meglio i residui del modello GARCH.
Skewed T Student Params ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ Location ┃ Scale ┃ Gamma ┃ Degrees of Freedom ┃ LogLikelihood ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 0.252536912233459… │ 0.7931626273828345 │ -0.3228989079727… │ 4.769267887102352 │ -1204.1528851052… │ │ BTC-USD │ 0.001702114020373… │ 0.6790751453997663 │ 0.01147859718582… │ 3.3067892720438783 │ -1203.4957732999… │ │ DASH-USD │ 0.3905158781548028 │ 0.7879525603521891 │ -0.6704196131287… │ 3.9902423864795264 │ -585.71440125403… │ │ XRP-USD │ 0.058080550672878… │ 0.6604521091349947 │ -0.1087986200691… │ 3.3914213261598682 │ -1103.9276325024… │ └──────────┴────────────────────┴────────────────────┴───────────────────┴────────────────────┴───────────────────┘
Generalized Logistic Params ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ Location ┃ Scale ┃ Shape ┃ LogLikelihood ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 0.23732458830417807 │ 0.48083967720439225 │ 0.7640744756521249 │ -1205.3666488127258 │ │ BTC-USD │ 0.125861732368985 │ 0.4894503257669105 │ 0.8525401171276977 │ -1214.435506980533 │ │ DASH-USD │ 0.3405336970501534 │ 0.41752163539790144 │ 0.6042602656979353 │ -587.6248517903006 │ │ XRP-USD │ 0.1149358907546211 │ 0.4703252736043755 │ 0.8395420047125439 │ -1121.7298065866314 │ └──────────┴─────────────────────┴─────────────────────┴────────────────────┴─────────────────────┘
<Figure size 640x480 with 0 Axes>
Procediamo quindi a selezionare la distribuzione che restituisce il valore massimo di Log-Likelihood".
Best Guessed Distribution for crypto ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ Skewed Student Log-Likelihood ┃ Generalized Logistic Log-Likelihood ┃ Chosen Distribution ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ -1204.1528851052553 │ -1205.3666488127258 │ Skewed Student │ │ BTC-USD │ -1203.4957732999053 │ -1214.435506980533 │ Skewed Student │ │ DASH-USD │ -585.7144012540351 │ -587.6248517903006 │ Skewed Student │ │ XRP-USD │ -1103.9276325024002 │ -1121.7298065866314 │ Skewed Student │ └──────────┴───────────────────────────────┴─────────────────────────────────────┴─────────────────────┘
La skewed student si rivela essere la distribuzione che in tutti i casi cattura meglio il comportamento dei residui del modello GARCH.
Questo significa che, essendo una Student, gli eventi rari sono più frequenti rispetto a quanto non lo siano invece in una Normale.
Gamma for Skewed Student ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ Gamma ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ -0.3228989079727239 │ │ BTC-USD │ 0.01147859718582429 │ │ DASH-USD │ -0.6704196131287173 │ │ XRP-USD │ -0.1087986200691051 │ └──────────┴─────────────────────┘
Come si vede dai valori, il gamma risulta negativo per tutte le crypto ad eccezione di Bitcoin.
La negatività di questo parametro implica che gli eventi "negativi" siano più frequenti di quelli positivi e che quindi gli investitori reagiscano peggio ad eventi negativi piuttosto che meglio ad eventi positiv (e viceversa).
Procediamo, dopo aver calcolato la miglior distribuzione per i residui, al calcolo di traiettorie come nell'approccio non parametrico.
A differenza del caso precedente, non facciamo delle estrazioni con reinserimento dall'insieme dei residui, ma generiamo dei valori partendo dalla distribuzione stimata.
<Figure size 640x480 with 0 Axes>
<Figure size 640x480 with 0 Axes>
Calcoliamo anche in questo caso la percentuale di punti che ricade nelle bande di predizione generate.
TestingSet captured by interval - Parametric Approch ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ % of Points ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 91.75257731958763 │ │ BTC-USD │ 92.92929292929293 │ │ DASH-USD │ 85.41666666666666 │ │ XRP-USD │ 83.87096774193549 │ └──────────┴───────────────────┘
Per valutare il modello usato, consideriamo le seguenti metriche di accuratezza:
Scale-Dependent Metrics
$ \text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i| $
$ \text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2 $
Percentage Error Metrics
$ \text{MAPE} = \frac{100}{n} \sum_{i=1}^{n} |\frac{y_i - \hat{y}_i}{y_i}|$
Relative Error Metrics
$ \text{SMAPE} = \frac{100}{n} \sum_{i=1}^{n} \frac{|y_i - \hat{y}_i|}{|y_i| + |\hat{y}_i|}$
Scale Free Metrics
$ \text{MASE} = \frac{MAE}{\frac{1}{m-1} \sum_{j=2}^{m} |y_j - y_{j-1}|} $
$ \text{RMSSE} = \sqrt{\frac{MSE}{\frac{1}{m-1} \sum_{j=2}^{m} (y_j - y_{j-1})^2}} $
Scale dependent Metrics ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ MAE ┃ MSE ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 0.006315552887893693 │ 1.1815450882428896e-05 │ │ BTC-USD │ 0.005618072478459816 │ 1.136996366734466e-05 │ │ DASH-USD │ 0.008527865727356422 │ 9.117142879378004e-06 │ │ XRP-USD │ 0.011689288301274857 │ 1.7466573526042232e-05 │ └──────────┴──────────────────────┴────────────────────────┘
Percentage Error Metrics ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ MAPE ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 130.32207276016655 │ │ BTC-USD │ 170.86280986425376 │ │ DASH-USD │ 99.06399667039288 │ │ XRP-USD │ 102.20041821598582 │ └──────────┴────────────────────┘
Relative Error Metrics ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ SMAPE ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 86.18360679939131 │ │ BTC-USD │ 87.91707791094564 │ │ DASH-USD │ 92.22020510225882 │ │ XRP-USD │ 96.82893543661696 │ └──────────┴───────────────────┘
Scale Free Error Metrics ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ MASE ┃ RMSSE ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 1.1815450882428896e-05 │ 3.3667285348235463e-06 │ │ BTC-USD │ 1.136996366734466e-05 │ 4.501645487777827e-06 │ │ DASH-USD │ 9.117142879378004e-06 │ 2.0439977491944203e-06 │ │ XRP-USD │ 1.7466573526042232e-05 │ 4.057028743119705e-06 │ └──────────┴────────────────────────┴────────────────────────┘
Confrontiamo per concludere i due approcci.
TestingSet captured by interval - Comparison ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Crypto ┃ % of Points - Param ┃ % of Points - Non Param ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ ETH-USD │ 91.75257731958763 │ 88.65979381443299 │ │ BTC-USD │ 92.92929292929293 │ 83.83838383838383 │ │ DASH-USD │ 85.41666666666666 │ 89.58333333333334 │ │ XRP-USD │ 83.87096774193549 │ 83.87096774193549 │ └──────────┴─────────────────────┴─────────────────────────┘
Come si vede l'approccio parametrico migliora di molto il numero di punti del testing set catturati dalle bande di predizione per ETH e BTC, mentre rimane uguale per XRP e addirittura peggiora per DASH, indice del fatto che per queste due crypto la distribuzione dei residui potrebbe essere diversa.